package com.zxxy.spring12.aspect;

import factory.Public;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

public class MyAspectJ {

    public void myBefore(JoinPoint jp) {
        System.out.println(jp.getSignature().getName());
        System.out.println("before...");
    }
    public void myAfterReturning(JoinPoint jp,Object ret) {
        System.out.println("after returning..."+ ret);
    }
    public object myAround(ProceedingJoinPoint pjp) throws Throwable{
        System.out.println("around before");
        Object obj = pjp.proceed();
        System.out.println("around after");
        return obj;
    }
    public void myThrowable(JoinPoint jp,Throwable e){
        System.out.println("throwing.." + e.getMessage());
        //write to log
    }
    public void myAfter(JoinPoint jp) {
        System.out.println(jp.getSignature().getName());
        System.out.println("after...");
    }
}
